<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>通讯录</title>
    <style>
        .box{
            width: 200px;height: 250px;border: 1px solid #000; margin: 100px auto;
            line-height: 40px;font-size: 20px;/*设置里面所有文本的行高都为40px，字体大小都是20px*/
            overflow: auto;/*超出容器的内容该如何显示*/
        }
        .box .title{
            background: #000;color: #fff;
            padding-left: 20px;/*让文字不要那么贴紧左边*/
            position: sticky; top: 0;
        }
        .box .uname{
            padding-left: 20px;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="title">A</div>
        <div class="uname">啊代开发票</div>
        <div class="uname">啊湛江烧烤</div>
        <div class="uname">啊啊啊</div>
        <div class="title">B</div>
        <div class="uname">banana</div>
        <div class="uname">别bb</div>
        <div class="uname">别烦我</div>
        <div class="uname">拜拜咯</div>
        <div class="title">C</div>
        <div class="uname">菜菜</div>
        <div class="uname">聪聪</div>
        <div class="title">D</div>
        <div class="uname">dog</div>
        <div class="uname">东东</div>
        <div class="uname">淡忘</div>
    </div>
</body>
</html>